import { defineStore } from 'pinia'
export const userStore = defineStore({
    id: 'user',
    state: () => {
        return {
            title: '',
            token:''
        }
    },
    getters: {
        getTitle: (state) => state.title,
    },
    actions: {
        setTitle(title:string) {
            this.title= title
        }
    },
    // 开启数据缓存
    persist: { //数据默认存在 sessionStorage 里，并且会以 store 的 id 作为 key
        enabled: true
    }
})
